package shaders;

import helpers.ColorHelper;

import java.awt.Color;
import java.awt.image.BufferedImage;

import javax.vecmath.Vector3d;

import essential.Ray;

public class WoodShader extends Shader {

	public WoodShader(){
		per.persistence = 0.5;
		per.n = 1;
	}
	
	@Override
	public Color calculateColor3d(Ray r, Vector3d sp) {
	
		double amount = 8*per.perlinNoise((float)sp.x,(float)sp.y,(float)sp.z);
		amount = amount - (int)amount;
		Color c =  ColorHelper.sumColor(
				ColorHelper.mulColor(color, amount),
				ColorHelper.mulColor(gradientColor, 1-amount));

		return c;
	}

	@Override
	public Shader copy() {
		Shader s = new WoodShader();
		this.copyFromTo(this,s);
		return s;
	}

	

	@Override
	public Color calculateColor2d(int x, int y) {
	
		return null;
	}

	@Override
	public double fBump(double x, double y, double z) {
		return 0;
	}

	@Override
	public Color textureColor(double x, double y) {
		return null;
	}

}
